package cn.gok.mmall.dao;

import cn.gok.mmall.pojo.User;
import org.apache.ibatis.annotations.Param;

/**
 * @Author: chenfan
 * @Date: 2021/3/25 17:25
 * @Description:
 */
public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    User queryUserByUsernameAndPassword(@Param("username") String username,
                                        @Param("password") String password);


    int checkUserName(String username);
    int checkEmail(String email);

    String getQuestionByUsername(String username);


    int checkAnswer(@Param("username") String username,
                    @Param("question") String question,
                    @Param("answer") String answer);


    int updatePasswordByUsername(@Param("username") String username,
                                 @Param("newPassword") String newPassword);
}
